#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <unistd.h>
#include <sys/shm.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <sys/select.h>
#include <string.h>

//XPutPixel(img, x, y, rgb)
struct virt_disp 
{
    Display *display;
    GC gc;
    XImage *img;
    Window win;
    int width;
    int height;
    unsigned char *fbaddr;
    XEvent event;
    pthread_mutex_t mutex;
};

int virt_disp_flush_fb(struct virt_disp *vd, int refresh_interval);
int virt_disp_init(struct virt_disp *vd);
int virt_disp_deinit(struct virt_disp *vd);



